package com.jsbs.iam.ident.mapper;

import com.jsbs.iam.ident.entity.IamExceptionLoginStrategy;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface IamExceptionLoginStrategyMapper {
    int deleteByPrimaryCode(@Param("list") List<String> list,@Param("companyCode") String companyCode);

    int insert(IamExceptionLoginStrategy record);

    int insertSelective(IamExceptionLoginStrategy record);

    IamExceptionLoginStrategy selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(IamExceptionLoginStrategy record);

    int updateByPrimaryKey(IamExceptionLoginStrategy record);

    /**
     * 查询所有的异常登陆策略
     * @return
     */
    List<IamExceptionLoginStrategy> getExceptionLoginStrategyAll(@Param("strategyNameOrCode") String strategyNameOrCode,
                                                                 @Param("companyCode") String companyCode);

    /**
     * 根据登录策略名称或者应用类型编码查询
     * @param code
     * @return
     */
    List<IamExceptionLoginStrategy> getExceptionLoginStrategyList(@Param("code") String code);

    /**
     * 异常登陆策略编码自增
     * @return
     */
    Integer getExceptionLoginStrategyCode ();

    /**
     * 根据异常登录策略名称查询
     * @param exceptionLoginStrategyName
     * @return
     */
    IamExceptionLoginStrategy getExceptionStrategyName (@Param("exceptionLoginStrategyName") String exceptionLoginStrategyName);

    /**
     * 根据应用类型编码查询
     * @param applyTypeCode
     * @return
     */
    IamExceptionLoginStrategy getApplyTypeCode (@Param("applyTypeCode") String applyTypeCode);
}